package com.taobaolite.index;

import com.taobaolite.item.ItemBody;
import com.taobaolite.tag.Tag;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping(path = "/api/v1/index")
public class IndexController {

    private final IndexService indexService;

    public IndexController(IndexService indexService) {
        this.indexService = indexService;
    }

    @GetMapping(path = "/hotitems")
    public List<ItemBody> getHotItems() {
        return indexService.getHotItems();
    }

    @GetMapping(path = "/tags")
    public List<Tag> getTags() {
        return indexService.getTags();
    }
}
